/*
 * @Description: string
 * @Author: rendc
 * @Date: 2022-10-09 10:22:32
 * @LastEditors: rendc
 * @LastEditTime: 2022-10-10 09:10:20
 */
var s = "string";
console.log(s.length);
console.log(s.charAt(0));
console.log(s.charCodeAt(0));
console.log(s.indexOf('t'));
console.log(s.lastIndexOf('t'));

console.log(s.slice(2));
console.log(s.slice(2, 5));

let fileName = "咏鹅(2).mp4"
let name = fileName.slice(0, fileName.length - 4);
console.log('🤡 CC - name', name);

var s = "  st r ing ";
console.log(s.substr(2, 3));
console.log(s.substring(2, 4)); // ri
console.log(s.trim()); // string

// username:"  admin   ";  =>后台=>   username.trim()  => admin => 数据库对比
// username:"  admin   "; => username.trim()  => username:"admin" =>后台=>  admin => 数据库对比

console.log(s.toLowerCase());
console.log(s.toUpperCase());
var s1 = "123";
var s2 = "456";
var s3 = s1 + s2;
console.log('🤡 CC - s3', s3);
var s4 = s1.concat(s2);
console.log('🤡 CC - s4', s4 + s3);

var num = 3;
console.log('🤡 CC - num', typeof num);
var num2 = String(num);
console.log('🤡 CC - num2', typeof num2);
